package com.lehecai.core.lottery;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.lehecai.core.IntegerBeanLabelItem;


public class PayPlatformType extends IntegerBeanLabelItem {

	private static final long serialVersionUID = 1L;
	private static final Logger logger = LoggerFactory.getLogger(PayPlatformType.class.getName());
	
	private static List<PayPlatformType> items = new ArrayList<PayPlatformType>();
	private static List<PayPlatformType> queryItems = new ArrayList<PayPlatformType>();
	private static Map<String, PayPlatformType> itemMap = new HashMap<String, PayPlatformType>();
	private String memo;
	
	protected PayPlatformType(String name, int value, String memo) {
		super(PayPlatformType.class.getName(), name, value);
		this.memo = memo;
		queryItems.add(this);
		if (value > 0) {
			items.add(this);
			itemMap.put(name, this);
		}
	}

	
	public static PayPlatformType getItem(int value){
		try {
			return (PayPlatformType)PayPlatformType.getResult(PayPlatformType.class.getName(), value);
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			return null;
		}
	}
	
	public static PayPlatformType getItemByName(String name){
		return itemMap.get(name);
	}
	
	public static List<PayPlatformType> getItems() {
		return items;
	}
	
	public static Map<String, PayPlatformType> getItemsMap() {
		return itemMap;
	}
	
	public String getMemo () {
		return this.memo;
	}

	public static final PayPlatformType ALL = new PayPlatformType("全部", -1, "");
	
	public static final PayPlatformType ALIPAY = new PayPlatformType("alipay", 1, "支付宝");
	public static final PayPlatformType SHENGPAY = new PayPlatformType("shengpay", 2, "盛付通");
	public static final PayPlatformType YEEPAYBANK = new PayPlatformType("yeepaybank", 3, "易宝");
	public static final PayPlatformType BAIFUBAO = new PayPlatformType("baifubao", 4, "百付宝");
	public static final PayPlatformType SOHU = new PayPlatformType("sohu", 5, "搜狐支付");
	public static final PayPlatformType UNICOMPAY = new PayPlatformType("unicompay", 6, "联通沃互联网支付");
	public static final PayPlatformType UMPAY = new PayPlatformType("umpay", 7, "联动优势支付");
	

}
